<ui:composition  xmlns="http://www.w3.org/1999/xhtml"
                 xmlns:ui="http://java.sun.com/jsf/facelets"
                 xmlns:h="http://java.sun.com/jsf/html"
                 xmlns:f="http://java.sun.com/jsf/core"
                 xmlns:a4j="http://richfaces.org/a4j"
                 xmlns:rich="http://richfaces.org/rich">
    <h:head>
        <title>会费</title>
        <style type="text/css">
            input[type="submit"]{ 
                padding:3px 5px 3px 5px;
                margin:3px 5px 3px 5px;
            }
            .dhClass{
                width: 80px !important;
            }
        </style> 
    </h:head>
    <h:form>
        <rich:panel header="会费计算" styleClass="content-hight">
            <h:outputText value="年度:"/>
            <h:selectOneMenu   value="#{feeCal.iyear}">
                <f:selectItem itemValue=" " itemLabel="-请选择年度-"/>
                <f:selectItems value="#{feeCal.iyearLi}" />
                <a4j:ajax event="change" render="button,showButton"/>
            </h:selectOneMenu>
            <h:outputText value="月份:"/>
            <h:selectOneMenu   value="#{feeCal.imonth}">
                <f:selectItem itemValue=" " itemLabel="-请选择月份-"/>
                <f:selectItem itemValue="1" itemLabel="1月"/>
                <f:selectItem itemValue="2" itemLabel="2月"/>
                <f:selectItem itemValue="3" itemLabel="3月"/>
                <f:selectItem itemValue="4" itemLabel="4月"/>
                <f:selectItem itemValue="5" itemLabel="5月"/>
                <f:selectItem itemValue="6" itemLabel="6月"/>
                <f:selectItem itemValue="7" itemLabel="7月"/>
                <f:selectItem itemValue="8" itemLabel="8月"/>
                <f:selectItem itemValue="9" itemLabel="9月"/>
                <f:selectItem itemValue="10" itemLabel="10月"/>
                <f:selectItem itemValue="11" itemLabel="11月"/>
                <f:selectItem itemValue="12" itemLabel="12月"/>
                <a4j:ajax event="change" render="button,showButton"/>
            </h:selectOneMenu>
            <a4j:commandButton id="button" value="计算" action="#{feeCal.feeCal_huiFei}"
                               render="showButton,message,fellCalTable"
                               onclick="this.disabled = 'true'"
                               disabled="#{empty feeCal.iyear or
                                           empty feeCal.imonth}"> 
            </a4j:commandButton>
            <a4j:commandButton id="showButton" value="查看" action="#{feeCal.queryList_huifei}"
                               render="message,fellCalTable" onclick="this.disabled = 'true'"
                               disabled="#{empty feeCal.iyear or
                                           empty feeCal.imonth}"/>
            <h:commandButton value="导出Excel" action="#{feeCal.exportExcel_huifei}"/>
            <h:outputLabel id="message" value="#{queryBean.err.errtip}" style="color:red" />
            <hr/>
            <rich:extendedDataTable id="fellCalTable"
                                    value="#{feeCal.detailAll_huifei}" var="item"
                                    rowKeyVar="rowKey"
                                    style="max-width:700px;max-height:300px"
                                    noDataLabel="无数据!">
                <f:facet name="header">
                    <h:outputText value="【#{feeCal.iyear}】年【#{feeCal.imonth}】月"
                                  rendered="#{not empty feeCal.iyear and not empty feeCal.imonth}"/>
                    <h:outputText value="会费扣缴统计表"/>
                </f:facet>
                <rich:column style="text-align: center" width="40px">
                    <f:facet name="header">序号</f:facet>
                    <h:outputText value="#{rowKey+1}"/>
                </rich:column>
                <h:column>
                    <f:facet name="header">部门</f:facet>
                    <h:outputText value="#{item.de.name}"/>
                </h:column>
                <h:column>
                    <f:facet name="header">姓名</f:facet>
                    <h:outputText value="#{item.cpsn_name}"/>
                </h:column>
                <rich:column style="text-align: right">
                    <f:facet name="header">会费</f:facet>
                    <h:outputText value="#{item.huifei}">
                        <f:convertNumber type="number" pattern="#,##0.00"/>
                    </h:outputText>
                </rich:column>
            </rich:extendedDataTable>
        </rich:panel>
    </h:form>
</ui:composition>
